package cn.dnf.basic.query;

import lombok.Data;

@Data
public class BaseQuery {
    //当前页
    private Integer currentPage = 1;
    //每页显示条数
    private Integer pageSize = 5;

    //高级查询
    private String keywords;

    //limit中的第一个参数
    public Integer getBegin(){

        return (this.currentPage-1)*this.pageSize;
    }

    public BaseQuery(Integer currentPage, Integer pageSize, String keywords) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
        this.keywords = keywords;
    }

    public BaseQuery() {
    }
}
